package com.yolib.sanyi.pic;

import android.graphics.BitmapFactory;

public class ImageOptions {
	
	public static int initSampSize(BitmapFactory.Options options, int showWidth, int showHeight)
	{
		int mWidth = options.outWidth;
		int mHeight = options.outHeight;
		
		int resizeWidthArg = mWidth / showWidth;
		int resizeHeightArg = mHeight / showHeight;
		
		if(resizeWidthArg == 0 || resizeHeightArg == 0)
			return 1;
		
		if(resizeWidthArg > resizeHeightArg)
			return resizeHeightArg;
		else
			return resizeWidthArg;
	}
}
